1. Guidance
Lecturer: Toshiyuki Masui
https://gyazo.com/1077ecfb9bbbe9bebcbe4e29e93b186a
2017/4/10
Lecture info
Lecture notes
Related info
Scrapbox
Information management / sharing system on the Web
https://i.gyazo.com/7057219f5b20ca8afd122945b72453d3.png
Scrapbox
A very modern Wiki
Text editor on the Wweb
Information management on the Web
Information sharing on the Web
Scrapbox info
Preparations for the class
Create a Scrapbox project with your studentId
sfc-pm2017-(yourStudentID)
e.g. sfc-pm2017-s00000tm
Self introduction
Name: Toshiyuki Masui
Worked at Sharp, Sony, Apple, etc.
Predictive input for mobile phones
“Flick” input for iPhone
Developed various I/F systems on various platforms
Running large Web services
Interested in UbiComp, InfoVis, Information Retrieval, etc.
Masui at Apple
http://gyazo.com/27357dbdc55a68142baee8c5d29ef075.png
POBox: Predictive Japanese text input
https://gyazo.com/43da8e84b189a054393a8288e1d18b80
"Flick input" for iPhone
T-Cube + Prediction
https://gyazo.com/1691febad27439d3bf44232c54dcb1e8.png
Masui's Web services
Masui's Books
http://hondana.org/%E5%A2%97%E4%BA%95/4756102816 http://gyazo.com/4f415439da4a838af43a73bf8325df55.png
http://hondana.org/%E5%A2%97%E4%BA%95/4756146627 http://gyazo.com/d7e6378a56a03c4c183185b475feeacc.png
http://hondana.org/%E5%A2%97%E4%BA%95/4873113784 http://gyazo.com/b5d8dcb8b3161e03a4ba6bf83ab3bbd8.png
http://hondana.org/%E5%A2%97%E4%BA%95/4873114616 http://gyazo.com/a75cf9e2eaaa5fa58e5af9faf705f3f6.png
http://hondana.org/%E5%A2%97%E4%BA%95/4873115043 http://gyazo.com/027dca09083cb76869c874bcdcb01dd9.png
http://www.kobunsha.com/img/sys/book/cover/9784334038458.jpg http://www.pitecan.com/sumaho/
Other SFC classes
User interface design
Modern Web technologies
Information visualization
Real-world interface
Aims of this lecture
Getting wider understandings of prorgramming
Understanding various programming concepts
Cultivating programming-oriented thinking
Getting programming tips
Merits of taking this class
Covering non-common programming issues
Issues not easily searchable on the Web
Issues not covered in standard textbooks
Topics not covered in this lecture
Programming basics
Software engineering
Theory of programming
Theory of computation
Complexity theory
Lambda calculus
Good textbooks available for these
Class schedule
Introduce various programming techniques
No examination (maybe)
Term paper submission required
Small exercises in the class
Self-learning encouraged
Task#1
Paste the code on your Scrapbox page
FizzBuzz problem
Write a program that prints the numbers from 1 to 100.
But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”.
For numbers which are multiples of both three and five print “FizzBuzz”.
Expected result
code:fizzbuzz.txt
1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz,
Programming on Scrapbox
code:fizzbuzz.rb
# your code here
SFC programming enviromnets
Computers in lecture rooms
Programming environments on PCs
Java, Ruby, Python, JavaScript, Processing, etc.
What is programming?
http://www.amazon.co.jp/dp/4121504895 https://gyazo.com/5e0a0c6d14e93409a434c46ea2891c99.png
Why do we write programs?
Programming is useful!
You can solve various problems easily
Programming is interesting!
Puzzle, etc.
Useful for everything!
Applications, Web services, art, ...
Modern programming environments
Software obstacles disappearing
Anybody can write programs anywhere with
JavaScript, Processing, Node, Coffee, etc.
Good communication libraries
Good graphics libraries
Hardware obstacles disappearing
Small and powerful boards
Various sensors
Real-world programming
History of programming environments
Before the PC era
Programming were for the experts
Large computers, “mini computers”
Dawn of personal computing (1980〜1990)
Simple programming environments
BASIC, HyperCard
Sunday programmers
History of programming environments
Personal computers everywhere (1990〜2000)
Home computing / office computing
Expensive programming environments
VisualC++, etc.
Programming only by experts
Age of open-source movement (2000〜2010)
Good codes available to everyone
History of programming environments
World-wide programming (2010〜)
Sharing everything
Programming anywhere / anytime / by everybody
Non-text programming
Sensor programming
http://hondana.org/%E5%A2%97%E4%BA%95/4873113784 https://gyazo.com/b5d8dcb8b3161e03a4ba6bf83ab3bbd8.png
Programming in a narrow sense
Text-based programming languages
C, Java, JavaScript, ...
Describe computing sequences
General-purpose
Programming in a wider sense
Parameter settings
Formula definitions
Constraint programming
Recipes and procedures
Dataflow visualizations
Programming by example
Parameter settings
Setting clock alarms
Kitchen timers
VCR settings
Constraint programming
Spreadsheets
Formula definitions
Define geometric constraints
Logic circuits
Cinderella
https://www.youtube.com/watch?v=9bEFCPwMWyE
http://pitecan.com/Cinderella/Kempe/ https://gyazo.com/2e7e705c07fd081b840c2417dee733e6.png
Logic circuits
https://gyazo.com/bdf52de821cba9f952f2bdeb2fd1070a.png
https://gyazo.com/d4bdb12896f82ffdad6cf0cf77ba65be.png
Text-based circuit representation
code:logic.rtl
library ieee;
use ieee.std_logic_1164.all;
entity T_FF1 is
port( R,T : in std_logic;
Q,QB : out std_logic);
end T_FF1;
-------------------------------------------------
architecture RTL of T_FF1 is
signal NODE : std_logic;
begin
Q <= NODE;
QB <= not NODE;
process(R,T)
begin
if (R = '0')then
NODE <= '0';
elsif (T 'event and T ='1')then
NODE <= not NODE;
end if;
end process;
end RTL;
Procedure definitions
Rube Goldberg machine
aka Pitagora-machine
Recipes
Music scores
Rube Goldberg machine
https://gyazo.com/210eaff521cdc11af3bbb37592f054c5.png
Video: The Way Things Go
https://www.youtube.com/watch?v=L_HWDQxcngE
Programming by Example
Dynamic Macro
Prediction system
Demo: Dynamic Macro
Automatic generation of keyboard macros
Visual programming
https://gyazo.com/87b08f3210ea5ba803981f6bc47e7584.png
Computing in the future
Everywhere / anytime / everyone
Augmenting human abilities
Artificial intelligence
Computer usages
Calculation
Theorem proving
Search
Communication
Computer usages
Games
Drawing / writing
Musical instruments
Simulations
Various arts
Computer usages
Ubiquitous computing
Artificial intelligence
Artificial life
more interesting topics
Lecture topics
Literate programming
Programming by example
String-based programming
State transition programming
Parallel programming
Visual programming}
Internet programming
Real-world programming
Evolutional Programming
User interface programing
Extreme programming
Programming with people
Other programming paradigms
Programming in the real-world
Resource-rich programming
Programming paradigms
Procedural programming
Structured programming
Data-flow programming
Object oriented programming
Functional programming
Declarative programming
Constraint programming
Logic programming
Beautiful code
http://www.amazon.co.jp/dp/0596510047 https://gyazo.com/4aabc8c3b3a0ad378923e7986d0221ec.png
Beautiful program
Concise
Elegant algorithm
Easy to read
Easy to understand
General
Dirty program
code:dirty.js
if(window!=top)top.location=location.href;
(function(){if(location.href.indexOf("nocheckbrowser")!=-1)return;if(!is_browser_supported)location="?ui=html&zy=b";var agt=navigator.userAgent.toLowerCase();var wk=/webkit\/(^ +)/.exec(agt);var g=/rv:(^;)+)/.exec(agt);var ie=/msie (\d+)/.exec(agt);var opr=window.opera&&parseFloat(window.opera.version());var sup=ie&&ie1>=7&&!opr||navigator.product=="Gecko"&&g&&g1>"1.8"||wk&&wk1.split(".")0> "522"||opr&&opr>=9.5;var win2k=agt.indexOf("windows nt 5.0")!=-1||agt.indexOf("windows 2000")!=-1;var win98OrMe=agt.indexOf("windows 98")!=-1;if(ie&&ie1==6&&!opr&&!win2k&&!win98OrMe){var jsv=Number(ScriptEngineMajorVersion()+"."+ScriptEngineMinorVersion());sup=jsv>=5.7||jsv==5.6&&ScriptEngineBuildVersion()>=8834}if(!sup)location="?ui=1";var c="jscookietest=valid";document.cookie=c;if(document.cookie.indexOf(c)== -1)location="html/nocookies.html";document.cookie=c+";expires=Thu, 01 Jan 1970 00:00:00 GMT";if(agt.indexOf("msie")!=-1&&document.all&&agt.indexOf("opera")==-1&&agt.indexOf("mac")==-1)eval('try{new ActiveXObject(agt.indexOf("msie 5")!=-1?"Microsoft.XMLHTTP":"Msxml2.XMLHTTP")}catch(e){location="html/noactivex.html"}')})()
Spaghetti programs
https://gyazo.com/ba6a0d78000d76428b935d3a1d63c4af.png
Road to better programming
Avoid bad tools
Don't use flowcharts!
Avoid bad textbooks
Know good idioms
Read beautiful codes
Hardware and programming
Von Neumann architecture
CPU + memory
Executing instructions
Logic operation based on programs on memory
Bit calculation and data transfer
Von Neumann architecture
https://gyazo.com/87eea7384aa3b9b0a2aa8ab65af15cc3.png
Non-standard hardware
Associative memories
Massively parallel search possible
Quantum computing
Completely different algorithms required
Masui laboratory
Real-world computing + real-world programming
Integration of Web and sensors in the real world
Task#1
Paste the code on your Scrapbox page